<HTML><HEAD><TITLE>refine(?Svar)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(conjunto)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>refine(?Svar)</H1>
Instanciate Svar to a value in its set domain.


<DL>
<DT><EM>?Svar</EM></DT>
<DD>A set domain variable or a ground set.
</DD>
</DL>
<H2>Description</H2>
   If Svar is a set domain variable, it labels Svar to its first possible
   value (which satisfies the constraints) by taking the largest possible
   set of elements chosen from the smallest one to the biggest one.  If
   there are several possible instances of Svar, it creates choice points.
   It backtracks on the element taken.  If Svar is a ground set, nothing
   happens.  Otherwise it fails.  If List is a possible list of set domain
   variables occuring in the program, the simplest labeling procedure is:

<P>
<PRE>
            labelings([]).
            labelings([S | List]) :-
                 refine(S),
                 labelings(List).
</PRE>

<H3>Fail Conditions</H3>
   Fails if Svar is not a set domain variable or ground set.


<H3>Resatisfiable</H3>
   On the taken elements.
<H2>Examples</H2>
<PRE>
[eclipse 21]: S `:: {} ..{1,2,5,3,8}, refine(S).

S = {1, 2, 3, 5, 8}     More? (;)
yes



</PRE>
<H2>See Also</H2>
<A HREF="../../lib/conjunto/BNN-2.html">`:: / 2</A>
</BODY></HTML>
